<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box">box</div>
    <script>
        // 获取元素的dom对象
        var box = document.getElementById('box')
        box.style.border = '1px solid red'
        box.style.padding = '10px'
        // 如果某个属性是多个英文单词通过-连接, 需要将其改写成小驼峰的命名
        box.style.backgroundColor = 'lightblue'
        box.style.fontSize = '40px'
        box.style.fontWeight = 700
    </script>
</body>

</html>